#!/usr/bin/env python
#coding: utf-8
'''
Created on 2017年2月22日

@author: Administrator
'''
from django.conf import settings
from common import settings as common_settings

LOGIN_URL = settings.LOGIN_URL
STATIC_URL = settings.STATIC_URL
LOGIN_SUCESS_URL = settings.LOGIN_SUCESS_URL
SESSION_COOKIE_DOMAIN = settings.SESSION_COOKIE_DOMAIN
DEFAULT_COMMAND_USER = settings.DEFAULT_COMMAND_USER

StateEnum = common_settings.StateEnum
STATE_CHOICES = common_settings.STATE_CHOICES
USERINFO_COOKIE_NAME = common_settings.USERINFO_COOKIE_NAME
get_state_desc = common_settings.get_state_desc
#默认用户头像
DEFAULT_AVATAR_FPATH = "images/auoffice/profile_small.jpg"

ACCOUNT_MEDIA_PATH = 'account/'
PROFILE_MEDIA_PATH = 'profile/'

ES_INDEX_USER_LIST = "es_index_user_list"
ES_INDEX_USER_LIST_TYPE = "user_list"

# 用户类型
class UserTypeEnum:
    DEFAULT = 0     # 普通用户
    
USER_TYPE_CHOICES = (
    (UserTypeEnum.DEFAULT, u'普通用户'),
)

# 性别
class UserSexEnum:
    UNKOWN = 'N'
    MALE = 'M'
    FEMALE = 'F'
    
USER_SEX_CHOICES = (
    (UserSexEnum.MALE, u"男"),
    (UserSexEnum.FEMALE, u"女"),
    (UserSexEnum.UNKOWN, u'保密')
)

def get_user_sex_desc(sex):
    for s in USER_SEX_CHOICES:
        if s[0] == sex:
            return s[1]
    return u"保密"

# 错误码分配
ERROR = {
    'PASSWORD_ERR': {'code': '11002', 'msg': u'密码错误'},
    'NOT_LOGIN_ERR': {'code': '62001', 'msg': u'你还没有登录，请先登录'},
    'IDCARD_VALIDATE_ERR': {'code': '62002', 'msg': u'身份认证失败'},
    'AUTH_ERR': {'code': '62003', 'msg': u'用户名或密码错误'},
    'USERNAME_FORMAT_ERR': {'code': '11020', 'msg': u'不是合法的手机或邮箱'}
}
ERROR.update(settings.ERROR)
